snippet wh "Width and height"
width: ${1},
height: ${0},
endsnippet

snippet pa "Padding"
padding: EdgeInsets.only(${1:left: ${2:0}, }${3:right: ${4:0}, }${5:top: ${6:0}, }${7:bottom: ${8:0}}),
endsnippet

snippet pah "Padding Horizontal"
padding: EdgeInsets.only(${1:left: ${2:0}, }${3:right: ${4:0}}),
endsnippet

snippet pav "Padding Vertical"
padding: EdgeInsets.only(${1:top: ${2:0}, }${3:bottom: ${4:0}}),
endsnippet

snippet mar "Margin"
margin: EdgeInsets.only(${1:left: ${2:0}, }${3:right: ${4:0}, }${5:top: ${6:0}, }${7:bottom: ${8:0}}),
endsnippet

snippet marh "Margin Horizontal"
margin: EdgeInsets.only(${1:left: ${2:0}, }${3:right: ${4:0}}),
endsnippet

snippet marv "Margin Vertical"
margin: EdgeInsets.only(${1:top: ${2:0}, }${3:bottom: ${4:0}}),
endsnippet

snippet br "BorderRadius"
borderRadius: BorderRadius.all(Radius.circular(${0})),
endsnippet

snippet dec "BoxDecoration"
decoration: BoxDecoration(
  color: ${1},
),${0}
endsnippet

snippet ba "BorderRadius"
border: Border.all(
  width: ${1},
  color: ${2},
),
endsnippet

snippet row "Row"
Row(children: [
  ${0}
]),
endsnippet

snippet rowa "Row with alignment"
Row(
  mainAxisAlignment: MainAxisAlignment.${1:start},
  crossAxisAlignment: CrossAxisAlignment.${2:start},
  children: [
    ${0}
  ],
),
endsnippet

snippet col "Column"
Column(children: [
  ${0}
]),
endsnippet

snippet cola "Column with alignment"
Column(
  mainAxisAlignment: MainAxisAlignment.${1:start},
  crossAxisAlignment: CrossAxisAlignment.${2:start},
  children: [
    ${0}
  ],
),
endsnippet

snippet con "Container"
Container(
  child: ${0},
)
endsnippet

snippet exp "Expanded"
Expanded(
  child: ${0},
)
endsnippet

snippet flx "Flexible"
Flexible(
  child: ${0},
)
endsnippet

snippet cons "Container Sized"
Container(
  width: ${1},
  height: ${2},
  child: ${0},
)
endsnippet

snippet cen "Center"
Center(child: ${0})
endsnippet

snippet ts "Text with text style"
Text(${1}, style: ${2}),${0}
endsnippet

snippet ss "TextStyle"
TextStyle(
  color: ${1},
  fontSize: ${2},
  fontWeight: w[${3}],
),${0}
endsnippet

snippet sw "SizedBox with width"
SizedBox(width: ${1}),${0}
endsnippet

snippet sh "SizedBox with height"
SizedBox(height: ${1}),${0}
endsnippet

snippet swh "SizedBox with width and height"
SizedBox(width: ${1}, height: ${2}),${0}
endsnippet

snippet scaf "Scaffold"
Scaffold(
  appBar: AppBar(
    title: Text('${1:Title}'),
  ),
  body: ${2:Container()}${0},
);
endsnippet

snippet sf "New Stateful Widget" b
class ${1:name} extends StatefulWidget {
  ${1:name}({});
  @override
  _${1:WidgetName}State createState() => _${1:WidgetName}State();
}
class _${1:index}State extends State<${1:index}> {
  @override
  Widget build(BuildContext context) {
    return Container(
       child: ${2:child},
    );
  }
}
endsnippet


snippet sl "New Stateless Widget" b
class ${1:name} extends StatelessWidget {
  const ${1:name}({});
  @override
  Widget build(BuildContext context) {
    return Container(
      child: ${2:child},
    );
  }
}
endsnippet

snippet wt "Colors.white"
color: colorWhite,
endsnippet

snippet inits "initState"
@override
void initState() {
  super.initState();
  ${0}
}
endsnippet

snippet dispose "dispose"
@override
void initState() {
  super.initState();
  ${0:}
}
endsnippet

snippet listv "ListView.builder"
ListView.builder(
  itemCount: ${1:1},
  itemBuilder: (BuildContext context, int index) {
    return ${2:Container()};
  },
)
endsnippet

snippet future "Future Builder"
FutureBuilder(
  future: ${1:Future},
  initialData: ${2:InitialData},
  builder: (BuildContext context, AsyncSnapshot snapshot) {
    if (snapshot.connectionState == ConnectionState.done)
      return ${3:Container();}
    return ${4:Container();}
  },
)
endsnippet

snippet stream "Stream Builder"
StreamBuilder<${1:dynamic}>(
  stream: ${2:yourStream},
  builder: (context, snapshot) {
    if (snapshot.hasData) {
      // TODO: do something with the data
      return ${3:Container()};
    } else if (snapshot.hasError) {
      // TODO: do something with the error
      return ${4:Text(snapshot.error.toString())};
    }
    // TODO: the data is not ready, show a loading indicator
    return ${5:Center(child: CircularProgressIndicator())};
  },
),
endsnippet

snippet try "try catch"
try {
} catch (e) {
}${0}
endsnippet

